package erlwitch.tree;

public class ErlangString extends Term {
	private String value;
	
	public ErlangString(int begin, int end, String value) {
		super(begin, end);
		this.value = value;
		//System.out.println("String: " + value + " at " + begin + " " + end);
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
	
	public ErlangString append(ErlangString s) {
		if (begin < s.begin) {
			// el string actual aparece antes
			value += s.value;
			begin = s.begin;
		} else {
			// el string nuevo aparece antes
			value = s.value + value;
			end = s.end;
		}
		return this;
	}
}
